#include <stdio.h>
int main()
{
	char ch[100];
	int i=0,j;
	while((ch[i]=getchar())!='\n')
	{
		i++;
	}
	for(j=0;j<=i;j++)
	{
		if (ch[j]>='A'&&ch[j]<='Z')
			ch[j]+=32;
		else if (ch[j]>='a'&&ch[j]<='z')
			ch[j]-=32;
	}
	for(j=0;j<=i;j++)
		printf("%c",ch[j]);
	printf("\n");
	return 0;
}